AC_SUBST(ENABLE_ON_X11)
if test "$enable_win32_backend" = "yes"; then
+ AC_MSG_CHECKING([for DWM])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[
+ #include <windows.h>
+ #include <dwmapi.h>
+ ]],
+ [[
+ DWM_BLURBEHIND bb;
+ memset (&bb, 0, sizeof (bb));
+ bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION;
+ ]]
+ )],
+ [dwm_ok=yes], [dwm_ok=no]
+ )
+ AC_MSG_RESULT($dwm_ok)
+ if test "$dwm_ok" = "yes"; then
+ AC_DEFINE([HAVE_W32_DWM], [1], [Define if W32 DWM API is available])
+ fi
+
cairo_backends="$cairo_backends cairo-win32"
GDK_BACKENDS="$GDK_BACKENDS win32"
backend_immodules="$backend_immodules,ime"
screen_class->get_monitor_geometry = gdk_win32_screen_get_monitor_geometry;
screen_class->get_monitor_workarea = gdk_win32_screen_get_monitor_geometry;
screen_class->get_system_visual = _gdk_win32_screen_get_system_visual;
- screen_class->get_rgba_visual = gdk_win32_screen_get_rgba_visual;
+ screen_class->get_rgba_visual = _gdk_win32_screen_get_system_visual;
screen_class->is_composited = gdk_win32_screen_is_composited;
screen_class->make_display_name = gdk_win32_screen_make_display_name;
screen_class->get_active_window = gdk_win32_screen_get_active_window;
#include "gdkdisplayprivate.h"
#include "gdkvisualprivate.h"
#include "gdkwin32window.h"
+#ifdef HAVE_W32_DWM
+#include <dwmapi.h>
+#endif
#include <cairo-win32.h>
if (attributes_mask & GDK_WA_CURSOR)
gdk_window_set_cursor (window, attributes->cursor);
+
+/* HAVE_W32_DWM means that we have necessary declarations at compile-time,
+ * but we'd still like to be able to run on XP, so we'll load the only non-XP
+ * function we need here at runtime.
+ */
+#ifdef HAVE_W32_DWM
+ {
+ typedef HRESULT (WINAPI *PFN_DwmEnableBlurBehindWindow)(HWND,
+ const DWM_BLURBEHIND *);
+ HMODULE dwmdll;
+ PFN_DwmEnableBlurBehindWindow dwmEnableBlurBehindWindow = NULL;
+
+ dwmdll = GetModuleHandle ("dwmapi.dll");
+ dwmEnableBlurBehindWindow = (PFN_DwmEnableBlurBehindWindow)
+ GetProcAddress (dwmdll, "DwmEnableBlurBehindWindow");
+
+ if (dwmEnableBlurBehindWindow)
+ {
+ /* Enable blurbehind, but give it an empty region, leaving us
+ with all the transparency with none of the blur */
+ DWM_BLURBEHIND bb;
+ HRGN hRgn;
+ hRgn = CreateRectRgn (0, 0, -1, -1);
+ if (hRgn != NULL)
+ {
+ HRESULT hr;
+ memset (&bb, 0, sizeof (bb));
+ bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION;
+ bb.hRgnBlur = hRgn;
+ bb.fEnable = TRUE;
+ hr = dwmEnableBlurBehindWindow (GDK_WINDOW_HWND (window), &bb);
+ if (S_OK != hr)
+ g_warning ("%s: %s failed: %" G_GINT64_MODIFIER "x", G_STRLOC,
+ "DwmEnableBlurBehindWindow", (guint64) hr);
+ DeleteObject (hRgn);
+ }
+ }
+ }
+#endif
}
GdkWindow *
if (!hdc)
return NULL;
- impl->cairo_surface = cairo_win32_surface_create (hdc);
+ impl->cairo_surface = cairo_win32_surface_create_with_alpha (hdc);
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key,
impl, gdk_win32_cairo_surface_destroy);